<template>
  <div>
    <div class="app-container">
      <mt-header fixed :title="title" />
      <mt-cell
        v-for="row in dataList"
        :key="row.id"
        :title="row.name"
        :to="{ path: '/app/partner/card', query: { id: currentRow.id } }"
        is-link
        @click.native="onClick(row)"
      >
        <img slot="icon" :src="row.image" width="24" height="24" />
      </mt-cell>
    </div>
  </div>
</template>

<script>
export default {
  name: 'PartnerEmployee',
  components: {},
  directives: {},
  filters: {},
  props: {
    title: { type: String, default: 'Partners' }
  },

  data() {
    return {
      currentRow: {}
    }
  },
  computed: {
    dataList: function() {
      return this.$store.state.appPartnerEmployee.dataList
    }
  },
  async created() {
    this.$store.dispatch('appPartnerEmployee/search')
  },

  methods: {
    onClick(item) {
      console.log('xxx, click item,', item)

      this.currentRow = item
    }
  }
}
</script>

<style type="text/css"></style>
